<script type="text/html" template lay-done="layui.data.sendParams(d);">
    <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-corecmsdriverdeliveryarea-editForm" id="LAY-app-corecmsdriverdeliveryarea-editForm">
        <input type="hidden" name="id" value="{{d.params.data.model.id || '' }}" />
        <!--<div class="layui-form-item">
        <label for="id" class="layui-form-label  layui-form-required"></label>
        <div class="layui-input-block">
            <input  type="number" min="0" max="999999" name="id"   lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.id || '' }}" placeholder="请输入" lay-reqText="请输入并为数字"  />
        </div>
    </div>-->
        <!--<div class="layui-form-item">
        <label for="driverId" class="layui-form-label  layui-form-required">司机</label>
        <div class="layui-input-block">
            <input  type="number" min="0" max="999999" name="driverId"   lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.driverId || '' }}" placeholder="请输入司机" lay-reqText="请输入司机并为数字"  />
        </div>
    </div>-->

        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">司机：</label>
            <div class="layui-input-inline">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-username"></i>
                </div>
                <select name="driverId">
                    <option value="" selected="selected">请选择</option>
                    {{# layui.each(d.params.data.drivers, function(index, item){ }}
                    <option value="{{ item.id }}" {{item.id===d.params.data.model.driverId?'selected="selected"':''}}>{{ item.name }}</option>
                    {{# }); }}
                </select>
            </div>
        </div>

        <!--<div class="layui-form-item">
            <label for="areaId" class="layui-form-label  layui-form-required">地区</label>
            <div class="layui-input-block">
                <div id="selectAreasBox" class="xm-select-demo"></div>
            </div>
        </div>-->

        <div class="layui-form-item">
            <label for="areaId" class="layui-form-label  layui-form-required">地区</label>
            <div class="layui-input-block">
                <textarea name="areaId" id="areaId" lay-verify="required" class="layui-textarea" lay-reqText="输入邮编前3位,多个邮编用,分割.如:082,098" placeholder="输入邮编前3位,多个邮编用,分割.如:082,098" >{{d.params.data.model.areaId || ''}}</textarea>
            </div>
        </div>

        <div hidden class="layui-form-item">
            <label for="createTime" class="layui-form-label  layui-form-required">创建时间</label>
            <div class="layui-input-block">
                <input name="createTime" id="editTime-corecmsdriverdeliveryarea-createTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入创建时间" lay-reqText="请输入创建时间" value="{{d.params.data.model.createTime || '' }}" />
            </div>
        </div>

        <div class="layui-form-item text-right core-hidden">
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-corecmsdriverdeliveryarea-editForm-submit" id="LAY-app-corecmsdriverdeliveryarea-editForm-submit" value="确认编辑">
        </div>
    </div>
</script>
<script>
    var debug= layui.setter.debug;
    layui.data.sendParams = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper','xmSelect', 'cropperImg'],
        function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , laydate = layui.laydate
                , upload = layui.upload
                , xmSelect = layui.xmSelect
                , cropperImg = layui.cropperImg
                , coreHelper = layui.coreHelper;

            /*let dataAreaStrArr = d.params.data.model.areaId.split(',')
            let dataAreaIntArr = []
            dataAreaStrArr.forEach(item => {
                dataAreaIntArr.push(+item);
            })*/
            /*var selectAreasBox = xmSelect.render({
                el: '#selectAreasBox',
                tips: '请选择地区',
                name: 'areaId',
                layVerify: 'required',
                prop: {
                    name: 'name',
                    value: 'id',
                },
                data: d.params.data.areas,
                initValue: dataAreaIntArr
            })*/

            laydate.render({
                elem: '#editTime-corecmsdriverdeliveryarea-createTime',
                type: 'datetime'
            });
            form.verify({
                
            });
            //重载form
            form.render(null, 'LAY-app-corecmsdriverdeliveryarea-editForm');
        })
    };
</script>
